<?php
class SureAction extends Action {
    
    //确定签到名单视图
    Public function index(){
        $id=(int)$_GET['id'];
        $this->data=M('peo')->find($id);
        $this->display();
    }

    //签到表单处理
    Public function Handle(){
        $dep=(int)$_GET['dep'];
        switch ($dep) {
            case 1:
                $dep='index';
                break;
            case 2:
            $dep='B';
                break;
        }
        $date= array(
            'id'=>(int)$_GET['id'],
            'reach'=>1,
            'login'=>time()
            );
        if(M('peo')->save($date)){
            $this->success('签到成功',U(GROUP_NAME.'/Index/'.$dep));
        }
        else{
            $this->error('签到失败');
        }
    }
    Public function newHandle(){
         $dep=(int)$_GET['dep'];
        switch ($dep) {
            case 1:
                $dep='index';
                break;
            case 2:
            $dep='B';
                break;
        }
        $date= array(
            'id'=>(int)$_GET['id'],
            'out'=>1,
            'outtime'=>time()
            );
        if(M('peo')->save($date)){
            $this->success('签退成功',U(GROUP_NAME.'/Index/'.$dep));
        }
        else{
            $this->error('签退失败');
        }
    }
        //确定签退名单视图
        Public function qt(){
        $id=(int)$_GET['id'];
        $dep=(int)$_GET['dep'];
        switch ($dep) {
            case 1:
            $dep='A组';
                break;
            case 2:
            $dep='B组';
                break;
            
        }
        $this->dep=$dep;
        $this->data=M('peo')->find($id);
        $this->display('index');
    }
}

?>